package com.example.springboot.Service.impl;

import com.example.springboot.config.Result;
import com.example.springboot.dao.UserMapper;
import com.example.springboot.Service.UserService;
import com.example.springboot.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;

import static com.example.springboot.config.enums.ResultCodeEnum.PARAM_LOST_ERROR;
import static com.example.springboot.config.enums.ResultCodeEnum.USER_ACCOUNT_ERROR;

@Service
public class UserServiceimpl implements UserService {
    @Autowired
    private UserMapper userMapper;
    @Override
    public void Save(User user) {
        userMapper.Save(user);
    }

    @Override
    public ArrayList<User> getAll() {
        return userMapper.getAll();
    }
    @Override
    public ArrayList<User> getAll1() {
        return userMapper.getAll1();
    }
    @Override
    public void DeleteById(int id) {
        userMapper.deleteById(id);
    }

    @Override
    public Boolean login(String id, String password) {
        return userMapper.login(id, password) > 0;
    }
}
